<?php  
require_once('../system/common.inc.php');
base_url();
$rewrite_mod = get_option('rewrite_mod');
switch($rewrite_mod){
	case 3:
		$rewrite_url = array('view' => 'view/%d', 'view_nohistory' => 'view/%d/nohistory', 'screenshot' => 'screenshot/%d', 'history' => 'history/%d', 'contact' => 'contact/%d', 'section' => 'section/%d', 'report' => 'report/%d', 'report_support' => 'report/%1$d/%2$d', 'more' => 'more/%d', 'more_offset' => 'more/%1$d/%2$d', 'misc' => 'misc');
		break;
	case 1:
	case 2:
	default:
		$rewrite_url = array('view' => 'index.php?method=view&amp;pid=%d', 'view_nohistory' => 'index.php?pid=%d&amp;addr=nohistory', 'screenshot' => 'index.php?method=screenshot&amp;pid=%d', 'history' => 'index.php?method=history&amp;pid=%d', 'contact' => 'index.php?method=contact&amp;pid=%d', 'section' => 'index.php?method=section&amp;pid=%d', 'report' => 'index.php?method=report&amp;pid=%d', 'report_support' => 'index.php?method=report&amp;pid=%1$d&amp;support=%2$d', 'more' => 'index.php?method=more&amp;pid=%d', 'more_offset' => 'index.php?method=more&amp;pid=%1$d&amp;offset=%2$d', 'misc' => 'misc.php');
		break;
}
function echo_rewrite_url($type, $variable1, $variable2=''){
	global $rewrite_url;
	echo SITE_URL;
	printf($rewrite_url[$type], $variable1, $variable2);
}
class_loader('Mobile_Detect');
$detect = new Mobile_Detect;
if(!$detect->isiOS()){
	if (DCRM_PCINDEX == 1) {
		header("Location: ".SITE_URL.$rewrite_url['misc.php']);
		exit();
	} else {
		$isCydia = false;
	}
} else {
	if (DCRM_MOBILE == 2) {
		if (!strpos($detect->getUserAgent(), 'Cydia')) {
			$isCydia = false;
		} else {
			$isCydia = true;
		}
	} else {
		exit('Access Denied');
	}
}
if (file_exists('Release')) {
	$release = file('Release');
	$release_origin = __('No Name');
	$release_mtime = filemtime('Release');
	$release_time = date('Y-m-d H:i:s',$release_mtime);
	foreach ($release as $line) {
		if(preg_match('#^Origin#', $line)) {
			$release_origin = trim(preg_replace("#^(.+):\\s*(.+)#","$2", $line));
		}
		if(preg_match("#^Description#", $line)) {
			$release_description = trim(preg_replace("#^(.+):\\s*(.+)#","$2", $line));
		}
	}
} else {
	$release_origin = __('许可协议&免责声明');
}
if (isset($_GET['pid'])) {
	if (ctype_digit($_GET['pid']) && intval($_GET['pid']) <= 10000) {
		function device_check(){
			global $detect;
			$device_type = array('iPhone', 'iPod', 'iPad');
			for ($i = 0; $i < count($device_type); $i++) {
				$check = $detect->version($device_type[$i]);
				if ($check !== false) {
					if (isset($_SERVER['HTTP_X_MACHINE'])) {
						$DEVICE = $_SERVER['HTTP_X_MACHINE'];
					} else {
						$DEVICE = 'Unknown';
					}
					$OS = str_replace('_', '.', $check);
					break;
				}
			}
			return array('DEVICE' => $DEVICE, 'OS' => $OS);
		}

		if (isset($_GET['method']) && $_GET['method'] == 'screenshot') {
			$index = 2;
			$title = __('View Screenshots');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'report') {
			$device_info = device_check();
			if (!isset($_GET['support'])) {
				$index = 3;
			} else {
				if ($_GET['support'] == '1') {
					$support = 1;
				} elseif ($_GET['support'] == '2') {
					$support = 2;
				} elseif ($_GET['support'] == '3') {
					$support = 3;
				} else {
					$support = 0;
				}
				$index = 4;
			}
			$title = __('Report Problems');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'history') {
			$index = 5;
			$title = __('Version History');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'contact') {
			$index = 6;
			$title = __('Contact us');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'section') {
			$index = 7;
			$title = __('Package Category');
		} elseif (isset($_GET['method']) && $_GET['method'] == 'more') {
			$index = 8;
			$section = DB::fetch_first("SELECT `Name`, `Icon` FROM `".DCRM_CON_PREFIX."Sections` WHERE `ID` = '".(int)$_GET['pid']."'");
			$q_name = DB::real_escape_string($section['Name']);
			if (isset($_GET['offset']) && !empty($_GET['offset']) && ctype_digit($_GET['offset'])) {
				$offset = intval($_GET['offset']);
			} else {
				$offset = 0;
			}
			$packages = DB::fetch_all("SELECT `ID`, `Name`, `Package` FROM `".DCRM_CON_PREFIX."Packages` WHERE (`Stat` = '1' AND `Section` = '".$q_name."') ORDER BY `ID` DESC LIMIT 10 OFFSET ".$offset);
			foreach($packages as $package){
				if(!empty($package)){
					if ($isCydia) { ?>
				<a href="cydia://package/<?php echo($package['Package']); ?>" target="_blank">
<?php					} else { ?>
				<a href="<?php echo_rewrite_url('view', $package['ID']);?>">
<?php					} ?>
					<img class="icon" src="<?php echo(SITE_URL); ?>icon/<?php echo(empty($section['Icon']) ? 'default/unknown.png' : $section['Icon']); ?>">
					<div>
						<div>
							<label>
								<p><?php echo($package['Name']); ?></p>
							</label>
						</div>
					</div>
				</a>
<?php
				}
			}
			exit();
		} elseif (!isset($_GET['method']) || (isset($_GET['method']) && $_GET['method'] == 'view')) {
			$index = 1;
			$title = __('View Package');
			$package_id = (int)DB::real_escape_string($_GET['pid']);
			$package_info = DB::fetch_first("SELECT `Name`, `Version`, `Author`, `Package`, `Description`, `DownloadTimes`, `Multi`, `CreateStamp`, `Size`, `Installed-Size`, `Section`, `Homepage`, `Tag`, `Level`, `Price`, `Purchase_Link`, `Changelog`, `Changelog_Older_Shows`, `Video_Preview`, `System_Support`, `ScreenShots` FROM `".DCRM_CON_PREFIX."Packages` WHERE `ID` = '".$package_id."' LIMIT 1");
			if ($package_info) $title = $title.' - '.$package_info['Name'];
		} else {
			httpinfo(405);
			exit();
		}
	} else {
		httpinfo(405);
		exit();
	}
} elseif (!isset($_GET['method'])) {
	$index = 0;
	$title = $release_origin;
} else {
	httpinfo(405);
	exit();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title><?php echo($title); ?></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="apple-mobile-web-app-title" content="<?php echo($release_origin); ?>" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
		<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="HandheldFriendly" content="true" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="robots" content="index, follow" />
<?php
if (defined("AUTOFILL_SEO")) {
?>
		<meta name="title" content="<?php echo(AUTOFILL_SEO); ?>" />
<?php
}
if (!empty($release_description)) {
?>
		<meta name="description" content="<?php echo($release_description); ?>" />
<?php
}
if (defined("AUTOFILL_KEYWORDS")) {
?>
		<meta name ="keywords" content="<?php echo(AUTOFILL_KEYWORDS); ?>" />
<?php
}
if ($isCydia) {
?>
		<base target="_blank">
<?php
} else {
?>
		<base target="_top">
<?php
}
?>
		<link rel="apple-touch-icon" href="<?php echo(SITE_URL); ?>../CydiaIcon.png">
		<link rel="shortcut icon" href="<?php echo(SITE_URL); ?>../favicon.ico">
		<link type="text/css" media="screen" rel="stylesheet" href="./help/xy.css">
	</head>
	<body class="pinstripe">
		<panel>

</head>
<body class="page-template-default page page-id-54 logged-in admin-bar page-two-column colors-light customize-support">
	<div class="site-content-contain">
		<div id="content" class="site-content">

<div class="wrap">
	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

			
<article id="post-54" class="post-54 page type-page status-publish hentry">
	<header class="entry-header">
	<div class="entry-content">
<p style="text-align: center;">
    <span style="font-size: 14px;"><strong>许可协议&amp;免责声明</strong></span>
</p>
<p>
    <span style="font-size: 12px;"><?php echo(AUTOFILL_SEO); ?>（以下简称“本软件源”）</span>
</p>
<p>
    <span style="font-size: 12px;">使用本软件源你应当阅读并遵守《“本软件源”许可及服务协议》以及《学习使用规则》</span>
</p>
<p>
    <strong><span style="font-size: 12px;">1.</span></strong><span style="font-size: 12px;">请你务必审慎阅读、充分理解各条款内容，否则你无权下载、安装或使用本软件源及相关服务。你的下载、安装、使用等行为即视为你已阅读并同意上述协议的约束。如您无法接受本协议您应当立即卸载删除本软件源。</span>
</p>
<p>
    <strong><span style="font-size: 12px;">2.</span></strong><span style="font-size: 12px;"><?php echo(AUTOFILL_SEO); ?>是由私人搭建的Cydia分享安装平台，本软件源插件和视频均来自BigBoss源以及各大网络收集，插件和视频的收集只供学习参考。</span>
</p>
<p>
    <strong><span style="font-size: 12px;">3.</span></strong><span style="font-size: 12px;">免责声明本软件源插件均为免费分享！其中一部分插件及教程由本软件源进行汉化及修改！如对作者及其他人造成影响！请邮件与我们联系！</span>
</p>
<p>
    <strong><span style="font-size: 12px;">4.</span></strong><span style="font-size: 12px;">若你是18周岁以下的未成年人，在使用本软件源前，应事先取得你家长或法定监护人的书面同意。</span>
</p>
<p>
    <strong><span style="font-size: 12px;">5.</span></strong><span style="font-size: 12px;">关于“本软件源”部分学习的软件中有可能需要登录一些账号信息、请您用小号登录（小号指的是不常用不会对您造成损害或损失）</span>
</p>
<p>
 <strong><span style="font-size: 12px;">6.</span></strong><span style="font-size: 12px;">如您有其它或者需要某些帮助的地方，可以通过本软件源预留的邮箱地址与我们进行反馈或咨询！邮箱地址：<?php echo(AUTOFILL_EMAIL); ?></span>
</p>
<p>
 <strong><span style="font-size: 12px;">7.</span></strong><span style="font-size: 12px;">使用本软件源里面的软件前，请阅读一下声明：本软件仅供学习交流使用严禁用于其它非法用途 如有违反！造成的任何后果均由使用者承担相应的刑事或民事责任！与本软件源无关！</span>
</p>
<p>
<strong><span style="font-size: 12px;">8.</span></strong><span style="font-size: 12px;">如您无法接受本协议您请立即卸载删除与本软件源相关的插件。如您继续使用等行为即视为你已阅读并同意上述协议的约束</span>
</p>
 <br>
<p style="text-align: right;">
    <strong><?php echo(AUTOFILL_SEO); ?></strong><br>
  <strong>特此声明！</strong>
</p>


</div></header></article></main></div></div></div></div></body></html>